codeigniter ง่าทำไม table มันไปอยู่บน header หละครับ

มี function ใน controller ดังนี้ครับ ซึ่งพอให้แสดงผล table มันดันไปอยู่บน header ซะงั้นครับ

เป็นเพราะอะไรครับ งงตึ๊บ FacepalmFacepalmFacepalm

public function show_registered(){
        $this->load->database();
        $this->load->helper('form');
        $this->load->helper('url');    
        $this->load->library('table');
        $this->load->helper('html');

        $this->load->view('template/header');
        
        $query = $this->db->get('registered');
        $data = array();
        $data[] = array('ลำดับที่','ภาพถ่าย');
        
        foreach($query->result() as $row){
            $image_properties = array(
                'src' => $row->photo,
                'width' => '180',
                'height' => '120',
            );

            $data[] = array($row->id,img($image_properties));
        }
        echo $this->table->generate($data);
        $this->load->view('template/footer');        
    }
คำตอบที่ได้รับเลือกจากเจ้าของกระทู้
ความคิดเห็นที่ 4
อ่ารู้แล้วครับ เกิดจาก  echo $this->table->generate($data);  ใน controller ตรง ๆ ครับ

ถ้า echo ตรงนี้จะแสดงผลก่อน show->view เสมอครับ ขอบคุณทุคำตอบครับ

หมูหมูหมู
แสดงความคิดเห็น
โปรดศึกษาและยอมรับนโยบายข้อมูลส่วนบุคคลก่อนเริ่มใช้งาน อ่านเพิ่มเติมได้ที่นี่